import axios from 'axios';

const request =axios.create({
  baseURL:'/api',
  timeout:500
})

request.interceptors.request.use(config => {
  return config
},error => {
  return Promise.reject('请求超时')
})

request.interceptors.response.use(response => {
  return response.data
},error => {
  return Promise.reject('请求失败')
})

export default request;